Skip to content

Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align with other Wan models and pipelines#390

Merged
copybara-service[bot] merged 1 commit intomainfrom
ninatu/wan-vace-mesh-init-bugs
Apr 29, 2026
Merged

Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align with other Wan models and pipelines#390
copybara-service[bot] merged 1 commit intomainfrom
ninatu/wan-vace-mesh-init-bugs

Conversation

@ninatu
Copy link
Copy Markdown
Collaborator

@ninatu ninatu commented Apr 24, 2026

  • Remove an unnecessary vae_spatial_axis_name assignment to vae_mesh in wan_pipeline.py, that fixes AttributeError: cannot assign to field 'vae_spatial_axis_name'.

  • Adopts the shared _create_common_components method (used by WanPipeline2_1, WanPipeline2_2, etc.) into _load_and_init of VaceWanPipeline2_1. This align initialization and resolves mesh axis handling issues during VaceWanPipeline2_1 initialization introduced by PR Ring attention integration and other optimizations #359.

  • Adopts new parameters mask_padding_tokens, enable_jax_named_scopes, use_base2_exp, use_experimental_scheduler into transformer_wan_vace.py and wan_vace_pipeline_2_1.py (following transformer_wan.py and wan_pipeline.py respectively) that align Wan-VACE transformer to Wan transformer.

  • Removes the load_common_components argument from from_pretrained and from_checkpoint in VaceWanPipeline2_1 for interface consistency.

@ninatu ninatu requested a review from entrpn as a code owner April 24, 2026 13:55
@github-actions
Copy link
Copy Markdown

@ninatu ninatu changed the title Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align w… Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align with other Wan models and pipeline Apr 24, 2026
@ninatu ninatu changed the title Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align with other Wan models and pipeline Fix mesh axis bugs & Fix Wan-VACE transformer and pipeline to align with other Wan models and pipelines Apr 24, 2026
…ith other Wan models and pipeline

* Remove an unnecessary `vae_spatial_axis_name` assignment to `vae_mesh` in `wan_pipeline.py`, that fixes `AttributeError: cannot assign to field 'vae_spatial_axis_name'`.

* Adopts the shared `_create_common_components` method (used by `WanPipeline2_1`, `WanPipeline2_2`, etc.) into `_load_and_init` of `VaceWanPipeline2_1`. This align initialization and resolves mesh axis handling issues during `VaceWanPipeline2_1` initialization introduced by PR #359.

* Adopts new parameters `mask_padding_tokens`, `enable_jax_named_scopes`, `use_base2_exp`, `use_experimental_scheduler` into `transformer_wan_vace.py` and `wan_vace_pipeline_2_1.py` (following `transformer_wan.py` and `wan_pipeline.py` respectively) that resolves attention errors (introduced by PR #359) and align Wan-VACE transformer to Wan transformer.

* Removes the `load_common_components` argument from `from_pretrained` and `from_checkpoint` in `VaeWanPipeline2_1` for interface consistency.
@ninatu ninatu force-pushed the ninatu/wan-vace-mesh-init-bugs branch from 10ade80 to fa877ab Compare April 24, 2026 13:57
vae_devices_array = flat_devices.reshape(total_devices // vae_spatial, vae_spatial)

vae_mesh = Mesh(vae_devices_array, ("redundant", "vae_spatial"))
vae_mesh.vae_spatial_axis_name = "vae_spatial"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eltsai can you check the significance of this change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @eltsai! just a kind reminder to take a look :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's safe to remove, in WAN VAE sharding we didn't read from vae_mesh

@copybara-service copybara-service Bot merged commit 53fe53a into main Apr 29, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants